﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
	xmlns:n="http://nRoute/schemas/2010/xaml" 
	xmlns:local_Controls="clr-namespace:nRoute.Samples.Netflix.Controls" 
	xmlns:local_Behaviors="clr-namespace:nRoute.Samples.Netflix.Behaviors" 
	xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
	x:Class="nRoute.Samples.Netflix.Views.GenresListingView"
    d:DesignHeight="600" d:DesignWidth="320" mc:Ignorable="d"
	n:Navigation.Title="Genres Listing">
		
	<i:Interaction.Behaviors>
		<n:BridgeViewModelBehavior/>
	</i:Interaction.Behaviors>
    
	<Grid x:Name="LayoutRoot" Background="White">
		
		<!--<Border Height="48" Background="#FFF1F1F1" VerticalAlignment="Top" BorderBrush="#FFDADADA" BorderThickness="0,0,0,1" Visibility="Collapsed">
			<Grid Margin="8,8,8,8">
				<Rectangle RadiusX="15" RadiusY="15" Stroke="#FFD4D4D4" Fill="White" />
				<Rectangle RadiusX="15" RadiusY="15" StrokeThickness="2" >
					<Rectangle.Stroke>
						<RadialGradientBrush RadiusY="0.921" RadiusX="0.991" Center="0.5,0.168" GradientOrigin="0.501,0.17">
							<GradientStop Color="#FF767676"/>
							<GradientStop Color="White" Offset="1"/>
						</RadialGradientBrush>
					</Rectangle.Stroke>
					<Rectangle.Fill>
						<LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
							<GradientStop Color="#FFEFEFEF"/>
							<GradientStop Color="White" Offset="0.297"/>
						</LinearGradientBrush>
					</Rectangle.Fill>
				</Rectangle>
				<TextBlock Margin="32,0,0,0" TextWrapping="Wrap" FontFamily="Verdana" FontSize="16" 
					Foreground="#FFBABABA" HorizontalAlignment="Left" VerticalAlignment="Center"
					Text="Search"/>
				<Path Data="M11,6 C11,8.7614241 8.7614241,11 6,11 C3.2385762,11 1,8.7614241 1,6 C1,3.2385762 3.2385762,1 6,1 C8.7614241,1 11,3.2385762 11,6 z M9.1339722,9.9879999 L13.508972,14.62" HorizontalAlignment="Left" Margin="10,0,0,0" Stretch="Fill" Stroke="#FF8D8C8C" StrokeThickness="2" UseLayoutRounding="False" Width="14.5" Height="15.5" VerticalAlignment="Center"/>
			</Grid>
		</Border>-->	
		<Grid>
			<Grid.RowDefinitions>
		        <RowDefinition Height="Auto"/>
		        <RowDefinition Height="*"/>
		    </Grid.RowDefinitions>
			<Border Height="32" Background="#FFF1F1F1" VerticalAlignment="Top" BorderBrush="#FFDADADA" 
				BorderThickness="0,0,0,1">
				<i:Interaction.Behaviors>
					<n:BoolValueVisibilityBehavior Value="{Binding IsSearching}"/>
				</i:Interaction.Behaviors>
				<Grid>
					<TextBlock Margin="34,0,8,0" TextWrapping="NoWrap" FontFamily="Trebuchet MS" 
						Text="{Binding SearchText, StringFormat=Results for ΄\{0\}΄}" 
						FontSize="16" Foreground="#FFA7A7A7" VerticalAlignment="Center" TextTrimming="WordEllipsis">
						<TextBlock.Effect>
							<DropShadowEffect ShadowDepth="1" BlurRadius="2" Color="White" Direction="-247"/>
						</TextBlock.Effect>
					</TextBlock>
					<Path Data="M11,6 C11,8.7614241 8.7614241,11 6,11 C3.2385762,11 1,8.7614241 1,6 C1,3.2385762 3.2385762,1 6,1 C8.7614241,1 11,3.2385762 11,6 z M9.1339722,9.9879999 L13.508972,14.62" HorizontalAlignment="Left" Margin="12,0,0,0" Stretch="Fill" Stroke="#FF8D8C8C" StrokeThickness="2" UseLayoutRounding="False" Width="14.5" Height="15.5" VerticalAlignment="Center"/>
				</Grid>
			</Border>
			
			<ListBox x:Name="GenresListBox" Width="320" BorderThickness="0" Padding="0" ItemsSource="{Binding Genres}"
				ItemTemplate="{StaticResource TopicTitleTemplate}" 	MinHeight="500"
				ItemContainerStyle="{StaticResource TopicTitleBoxItemStyle}" 
				ScrollViewer.HorizontalScrollBarVisibility="Disabled"
				ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.Row="1">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="SelectionChanged">
						<i:Interaction.Behaviors>
							<ei:ConditionBehavior>
								<ei:ConditionalExpression>
									<ei:ComparisonCondition LeftOperand="{Binding SelectedIndex, ElementName=GenresListBox}" Operator="NotEqual" RightOperand="-1"/>
								</ei:ConditionalExpression>
							</ei:ConditionBehavior>
						</i:Interaction.Behaviors>
						<n:NavigateAction HandlerName="ContentContainer" Url="Content/Netflix/Titles/" >
							<n:DependencyParameter Key="MovieTitles" Value="{Binding SelectedItem.Titles, ElementName=GenresListBox}"/>
							<n:DependencyParameter Key="PageTitle" 
								Value="{Binding SelectedItem.Name, ElementName=GenresListBox, StringFormat=Genre: \{0\}}"/>
						</n:NavigateAction>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</ListBox>
            
		</Grid>
		<local_Controls:WorkingIndicator IsWorking="{Binding IsLoading}" Visibility="Collapsed"/>
	</Grid>
	
</UserControl>
